$('#dg').datagrid({
    url:'search',
    columns:[[
        {field:'lo_us_id',title:'用户ID',width:100,hidden:true},
        {field:'username',title:'姓名',width:120,halign:'center'},
        {field:'lo_uid',title:'账号',width:140,halign:'center'},
        {field:'lo_processor',title:'平台版本号',width:150,halign:'center'},
        {field:'lo_computername',title:'设备序列号',width:200,halign:'center'},
        {field:'lo_ip',title:'客户IP',width:120,halign:'center',align:'center'},
        {field:'lo_date',title:'登录时间',width:160,halign:'center',align:'center'},
        {field:'lo_mac',title:'客户MAC地址',width:200,halign:'center',align:'center'},
        {field:'lo_model',title:'设备型号',width:150,halign:'center',align:'center'}
    ]],
    pagination:true,
    toolbar: '#tb',
    pageSize: 50,
    showHeader: true,
    singleSelect: false,
    // onLoadSuccess: function (data) {
    //     var computer = $("input[name='computer']").val();
    //     if(computer != ''){
    //         $("#dg").datagrid("mergeEqualCells", ["username", "lo_computername"])
    //     }
    //     console.log(data.total)
    // }
});

$('#search').click(function() {
    var mintime = $("input[name='mintime']").val();
    var maxtime = $("input[name='maxtime']").val();
    // var name = $("input[name='name']").val();
    // var computer = $("input[name='computer']").val();
    // var mac = $("input[name='mac']").val();
    var item = xhExtra.getValue($('#item'));
    var itemValue = xhExtra.getValue($('#itemValue'));
    $('#dg').datagrid('load', {
        mintime: mintime,
        maxtime: maxtime,
        // name: name,
        // computer: computer,
        // mac: mac
        item: item,
        itemValue: itemValue
    });
});
